Skip to content

OCPBUGS-105510: images: add BUILD_VERSION arg - #10781

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
petr-muller:trt-2892-installer-build-version-in-ci
Aug 24, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
petr-muller:trt-2892-installer-build-version-in-ci

Conversation

@petr-muller

@petr-muller petr-muller commented Aug 20, 2026

Copy link
Copy Markdown
Member

Add a BUILD_VERSION arg to our CI images, which will be set in the CI environment and then set that as an environment variable to pass to the build scripts. This is similar to the pattern of ART/OSBS.

Currently, with BUILD_VERSION unset in CI, we fall back to the git tags. But with 5.0 & 4.23 having identical commits, we need a way to distinguish between the two different builds, in which case we can just adopt the same pattern used by ART/OSBS.

The images can be built in three modes:

  1. Outside ART but without build arg passed. Build arg BUILD_VERSION has a "" default value, this gets exposed to the hack/build.sh as an envvar and the script falls back to using git tags, like before this change.
  2. Outside ART, with build arg passed. The passed value will be exposed to the hack/build.sh as BUILD_VERSION envvar and will prevent the git tag fallback. We will use this mode in selected CI configs to force using a certain version when needed.
  3. ART tooling injects ENV BUILD_VERSION <value> into Dockerfiles. ENV instructions override ARG ones[1], so ART-built images will correctly use whatever ART injects, no matter if anything passes a value for the build arg or not.

[1] https://docs.docker.com/reference/dockerfile/#using-arg-variables

Co-authored-by: Petr Muller muller@redhat.com

Summary by CodeRabbit

  • Chores
    • Added optional build version metadata support across CI container images and installer build environments.
    • Standardized version handling for bare-metal, libvirt, OpenStack, and installer image builds.
    • Existing build workflows remain compatible when no version is provided.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Aug 20, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@petr-muller: This pull request references Jira Issue OCPBUGS-105510, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.1.0) matches configured target version for branch (5.1.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Add a BUILD_VERSION arg to our CI images, which will be set in the CI environment and then set that as an environment variable to pass to the build scripts. This is similar to the pattern of ART/OSBS.

Currently, with BUILD_VERSION unset in CI, we fall back to the git tags. But with 5.0 & 4.23 having identical commits, we need a way to distinguish between the two different builds, in which case we can just adopt the same pattern used by ART/OSBS.

The images can be built in three modes:

  1. Outside ART but without build arg passed. Build arg BUILD_VERSION has a "" default value, this gets exposed to the hack/build.sh as an envvar and the script falls back to using git tags, like before this change.
  2. Outside ART, with build arg passed. The passed value will be exposed to the hack/build.sh as BUILD_VERSION envvar and will prevent the git tag fallback. We will use this mode in selected CI configs to force using a certain version when needed.
  3. ART tooling injects ENV BUILD_VERSION <value> into Dockerfiles. ENV instructions override ARG ones[1], so ART-built images will correctly use whatever ART injects, no matter if anything passes a value for the build arg or not.

[1] https://docs.docker.com/reference/dockerfile/#using-arg-variables

Co-authored-by: Petr Muller muller@redhat.com

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 8e0e7570-e137-4352-9a07-be06966ba748

📥 Commits

Reviewing files that changed from the base of the PR and between 1966deb and 5b449cd.

📒 Files selected for processing (6)
  • images/baremetal/Dockerfile.ci
  • images/installer-artifacts/Dockerfile.rhel
  • images/installer/Dockerfile.ci
  • images/installer/Dockerfile.upi.ci
  • images/libvirt/Dockerfile.ci
  • images/openstack/Dockerfile.ci
🚧 Files skipped from review as they are similar to previous changes (5)
  • images/baremetal/Dockerfile.ci
  • images/openstack/Dockerfile.ci
  • images/installer/Dockerfile.ci
  • images/libvirt/Dockerfile.ci
  • images/installer/Dockerfile.upi.ci

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The Docker builder stages now declare a BUILD_VERSION argument across CI images and installer artifact builds.

Changes

BUILD_VERSION configuration

Layer / File(s) Summary
CI image builder arguments
images/baremetal/Dockerfile.ci, images/installer/Dockerfile.ci, images/installer/Dockerfile.upi.ci, images/libvirt/Dockerfile.ci, images/openstack/Dockerfile.ci
The builder stages declare the BUILD_VERSION argument.
Installer artifact builder arguments
images/installer-artifacts/Dockerfile.rhel
The macOS AMD64, macOS ARM64, Linux AMD64, and Linux ARM64 builder stages declare BUILD_VERSION with empty defaults.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 5b449

The change adds an optional BUILD_VERSION value to CI image builds while preserving the existing fallback behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding the BUILD_VERSION argument to images.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (6 skipped: 6 unsupported.)
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR changes only nine Dockerfile ARG declarations; no Ginkgo test files or test titles were added or modified, so no dynamic test name was introduced.
Test Structure And Quality ✅ Passed The pull request changes only six Dockerfiles by adding BUILD_VERSION ARG declarations; it changes no Ginkgo tests or test-like paths.
Microshift Test Compatibility ✅ Passed The pull request changes only six Dockerfiles by adding BUILD_VERSION ARG declarations; it adds no Ginkgo e2e tests or MicroShift-incompatible API usage.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The pull request changes only six Dockerfiles and adds no Ginkgo e2e tests, so the SNO multi-node compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The patch changes only six Dockerfiles by adding BUILD_VERSION ARG declarations; no manifests, operators, controllers, or scheduling constraints changed.
Ote Binary Stdout Contract ✅ Passed The commit changes only six Dockerfiles by adding builder-stage ARG BUILD_VERSION; it changes no Go, main, or suite-setup code and introduces no stdout write.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The patch adds only BUILD_VERSION ARG lines to six Dockerfiles; it adds no Ginkgo tests, IPv4 assumptions, or external-connectivity test behavior.
No-Weak-Crypto ✅ Passed The commit adds only nine ARG BUILD_VERSION="" Dockerfile lines; the diff introduces no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed HEAD^..HEAD adds only ARG BUILD_VERSION="". It adds no privileged, host namespace, SYS_ADMIN, or allowPrivilegeEscalation directive, and final stages retain USER 1000:1000.
No-Sensitive-Data-In-Logs ✅ Passed The diff adds only empty-default BUILD_VERSION ARG declarations; no credentials or log statements are introduced, and hack/build.sh uses the value only as a version string.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from gryf and iurygregory August 20, 2026 14:18
@petr-muller
petr-muller force-pushed the trt-2892-installer-build-version-in-ci branch from 5d68de9 to 34f9a2d Compare August 20, 2026 14:18
@petr-muller

Copy link
Copy Markdown
Member Author

Supersedes #10771

petr-muller added a commit to petr-muller/release that referenced this pull request Aug 20, 2026
Will allow rehearse-test the changes in openshift/installer#10781 once it lands
@petr-muller

Copy link
Copy Markdown
Member Author

Test actually passed but Boskos call had a hiccup:

INFO[2026-08-20T15:02:43Z] Running multi-stage phase test               
INFO[2026-08-20T15:02:43Z] Running step openstack-manifests-openstack-test-manifests. 
WARN[2026-08-20T15:04:33Z] Failed to update lease "58a3ab89-ab2d-4f08-a09b-62bf5ffa24ee"  error=status 502 Bad Gateway, status code 502 updating 58a3ab89-ab2d-4f08-a09b-62bf5ffa24ee
...
INFO[2026-08-20T15:08:18Z] Step openstack-manifests-openstack-test-manifests succeeded after 5m34s. 
INFO[2026-08-20T15:08:18Z] Step phase test succeeded after 5m34s.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INFO[2026-08-20T15:08:18Z] Running multi-stage phase post               
INFO[2026-08-20T15:08:18Z] Running step openstack-manifests-openstack-deprovision-credentials. 
WARN[2026-08-20T15:08:31Z] Failed to update lease "58a3ab89-ab2d-4f08-a09b-62bf5ffa24ee"  error=status 502 Bad Gateway, status code 502 updating 58a3ab89-ab2d-4f08-a09b-62bf5ffa24ee
INFO[2026-08-20T15:08:34Z] Step openstack-manifests-openstack-deprovision-credentials succeeded after 16s. 
INFO[2026-08-20T15:08:34Z] Step phase post succeeded after 16s.         
INFO[2026-08-20T15:08:34Z] Releasing leases for test openstack-manifests 
WARN[2026-08-20T15:08:48Z] Failed to update lease "58a3ab89-ab2d-4f08-a09b-62bf5ffa24ee"  error=no resource name 58a3ab89-ab2d-4f08-a09b-62bf5ffa24ee
ERRO[2026-08-20T15:08:48Z] Failed to release leaked leases               error=no resource name 58a3ab89-ab2d-4f08-a09b-62bf5ffa24ee
WARN[2026-08-20T15:08:48Z] Would leak leases: [58a3ab89-ab2d-4f08-a09b-62bf5ffa24ee] 
INFO[2026-08-20T15:08:48Z] Ran for 49m34s                               
ERRO[2026-08-20T15:09:02Z] Some steps failed:                           
ERRO[2026-08-20T15:09:02Z] 
  * could not run steps: step openstack-manifests failed: status 502 Bad Gateway, statusCode 502 releasing 58a3ab89-ab2d-4f08-a09b-62bf5ffa24ee 
INFO[2026-08-20T15:09:02Z] Reporting job state 'failed' with reason 'executing_graph:step_failed:utilizing_lease:releasing_lease' 

@petr-muller

Copy link
Copy Markdown
Member Author

/test openstack-manifests

1 similar comment
@tthvo

tthvo commented Aug 20, 2026

Copy link
Copy Markdown
Member

/test openstack-manifests

Comment thread images/installer-artifacts/Dockerfile.rhel Outdated
@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 20, 2026
Add a BUILD_VERSION arg to our CI images, which will be set in
the CI environment and then set that as an environment variable
to pass to the build scripts. This is similar to the pattern of
ART/OSBS.

Currently, with BUILD_VERSION unset in CI, we fall back to the git
tags. But with 5.0 & 4.23 having identical commits, we need a way
to distinguish between the two different builds, in which case
we can just adopt the same pattern used by ART/OSBS.

The images can be built in three modes:
1. Outside ART but without build arg passed. Build arg
   `BUILD_VERSION` has a `""` default value, this gets exposed to
   the `hack/build.sh` as an envvar and the script falls back to
   using git tags, like before this change.
2. Outside ART, with build arg passed. The passed value will be
   exposed to the `hack/build.sh` as `BUILD_VERSION` envvar and
   will prevent the git tag fallback. We will use this mode in
   selected CI configs to force using a certain version when needed.
3. ART tooling injects `ENV BUILD_VERSION <value>` into Dockerfiles.
   ENV instructions override ARG ones[1], so ART-built images will
   correctly use whatever ART injects, no matter if anything passes
   a value for the build arg or not.

[1] https://docs.docker.com/reference/dockerfile/#using-arg-variables

Co-authored-by: Petr Muller <muller@redhat.com>
@petr-muller
petr-muller force-pushed the trt-2892-installer-build-version-in-ci branch from 34f9a2d to 5b449cd Compare August 21, 2026 09:38
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 21, 2026
@petr-muller

Copy link
Copy Markdown
Member Author

/pipeline required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn-upi
/test e2e-azure-ovn-upi
/test e2e-gcp-ovn-upi
/test e2e-metal-assisted
/test e2e-metal-ipi-ovn
/test e2e-metal-ipi-ovn-dualstack
/test e2e-metal-ipi-ovn-ipv6
/test e2e-metal-ipi-ovn-swapped-hosts
/test e2e-metal-ipi-ovn-virtualmedia
/test e2e-metal-ovn-two-node-arbiter
/test e2e-metal-ovn-two-node-fencing
/test e2e-metal-single-node-live-iso
/test e2e-openstack-dualstack-upi
/test e2e-openstack-nfv-intel
/test e2e-openstack-ovn
/test e2e-openstack-proxy
/test e2e-vsphere-ovn-upi
/test e2e-vsphere-ovn-upi-zones
/test e2e-aws-ovn

@tthvo tthvo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tthvo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 21, 2026
@petr-muller

Copy link
Copy Markdown
Member Author

/verified later

Sufficiently confident about the PR to merge: images build, CI (mostly 😅 ) passes. Build args passing will be validated via rehearsals. We will need to pay attention to ART builds.

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@petr-muller: /verified later <@username> requires at least one GitHub @username to be specified (it can be a comma delimited list). It indicates the engineer(s) that will be performing the verification. See https://docs.ci.openshift.org/docs/architecture/jira/#premerge-verification for more information.

Details

In response to this:

/verified later

Sufficiently confident about the PR to merge: images build, CI (mostly 😅 ) passes. Build args passing will be validated via rehearsals. We will need to pay attention to ART builds.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@petr-muller

Copy link
Copy Markdown
Member Author

/verified later @petr-muller

@openshift-ci-robot openshift-ci-robot added verified-later verified Signifies that the PR passed pre-merge verification criteria labels Aug 21, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@petr-muller: This PR has been marked to be verified later by @petr-muller.

Details

In response to this:

/verified later @petr-muller

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@petr-muller

Copy link
Copy Markdown
Member Author

/retest-required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 1966deb and 2 for PR HEAD 5b449cd in total

@tthvo

tthvo commented Aug 22, 2026

Copy link
Copy Markdown
Member

/test e2e-gcp-ovn-upi

@tthvo

tthvo commented Aug 22, 2026

Copy link
Copy Markdown
Member

/cherry-pick release-5.0

@openshift-cherrypick-robot

Copy link
Copy Markdown

@tthvo: once the present PR merges, I will cherry-pick it on top of release-5.0 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-5.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@petr-muller

Copy link
Copy Markdown
Member Author

/test e2e-gcp-ovn-upi

@petr-muller

Copy link
Copy Markdown
Member Author

Does e2e-gcp-ovn-upi ever pass? Does not seem like that from the history. I see it is being overriden in other recent PRs like #10769 or #10766 . I have override powers but do not feel appropriate to use them in teams' component repos 😅

@tthvo would you consider an override?

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 41210aa and 1 for PR HEAD 5b449cd in total

@openshift-ci

openshift-ci Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@petr-muller: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-metal-assisted 5b449cd link false /test e2e-metal-assisted
ci/prow/e2e-openstack-dualstack-upi 5b449cd link false /test e2e-openstack-dualstack-upi
ci/prow/e2e-metal-single-node-live-iso 5b449cd link false /test e2e-metal-single-node-live-iso
ci/prow/e2e-vsphere-ovn-upi-zones 5b449cd link false /test e2e-vsphere-ovn-upi-zones
ci/prow/e2e-azure-ovn-upi 5b449cd link false /test e2e-azure-ovn-upi
ci/prow/e2e-metal-ipi-ovn 5b449cd link false /test e2e-metal-ipi-ovn
ci/prow/e2e-openstack-proxy 5b449cd link false /test e2e-openstack-proxy

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@petr-muller

Copy link
Copy Markdown
Member Author

/test e2e-gcp-ovn-upi

@tthvo

tthvo commented Aug 24, 2026

Copy link
Copy Markdown
Member

/override-sticky ci/prow/e2e-gcp-ovn-upi

Does e2e-gcp-ovn-upi ever pass? Does not seem like that from the history. I see it is being overriden in other recent PRs like #10769 or #10766 . I have override powers but do not feel appropriate to use them in teams' component repos 😅

Yea, some e2e tests failed, but they're unrelated though. Since the image build and install completes, I think that's enough evidence. Let's keep an eye on ART builds after merging 👀

@tthvo

tthvo commented Aug 24, 2026

Copy link
Copy Markdown
Member

/skip

@openshift-ci

openshift-ci Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@tthvo: Overrode contexts on behalf of tthvo: ci/prow/e2e-gcp-ovn-upi

These overrides will persist across retests on the current HEAD SHA. Pushing a new commit will clear them. Use /override-cancel to remove them.

Details

In response to this:

/override-sticky ci/prow/e2e-gcp-ovn-upi

Does e2e-gcp-ovn-upi ever pass? Does not seem like that from the history. I see it is being overriden in other recent PRs like #10769 or #10766 . I have override powers but do not feel appropriate to use them in teams' component repos 😅

Yea, some e2e tests failed, but they're unrelated though. Since the image build and install completes, I think that's enough evidence. Let's keep an eye on ART builds after merging 👀

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tthvo

tthvo commented Aug 24, 2026

Copy link
Copy Markdown
Member

/tide refresh

@petr-muller

Copy link
Copy Markdown
Member Author

/override-sticky ci/prow/e2e-gcp-ovn-upi

Don't come back

@openshift-ci

openshift-ci Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@petr-muller: Overrode contexts on behalf of petr-muller: ci/prow/e2e-gcp-ovn-upi

These overrides will persist across retests on the current HEAD SHA. Pushing a new commit will clear them. Use /override-cancel to remove them.

Details

In response to this:

/override-sticky ci/prow/e2e-gcp-ovn-upi

Don't come back

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@petr-muller

Copy link
Copy Markdown
Member Author

/meow

@openshift-ci

openshift-ci Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@petr-muller: cat image

Details

In response to this:

/meow

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-bot
openshift-merge-bot Bot merged commit cceed15 into openshift:main Aug 24, 2026
34 checks passed
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@petr-muller: Jira Issue OCPBUGS-105510: All pull requests linked via external trackers have merged:

This pull request has the verified-later tag and will need to be manually moved to VERIFIED after testing. Jira Issue OCPBUGS-105510 has been moved to the MODIFIED state.

Details

In response to this:

Add a BUILD_VERSION arg to our CI images, which will be set in the CI environment and then set that as an environment variable to pass to the build scripts. This is similar to the pattern of ART/OSBS.

Currently, with BUILD_VERSION unset in CI, we fall back to the git tags. But with 5.0 & 4.23 having identical commits, we need a way to distinguish between the two different builds, in which case we can just adopt the same pattern used by ART/OSBS.

The images can be built in three modes:

  1. Outside ART but without build arg passed. Build arg BUILD_VERSION has a "" default value, this gets exposed to the hack/build.sh as an envvar and the script falls back to using git tags, like before this change.
  2. Outside ART, with build arg passed. The passed value will be exposed to the hack/build.sh as BUILD_VERSION envvar and will prevent the git tag fallback. We will use this mode in selected CI configs to force using a certain version when needed.
  3. ART tooling injects ENV BUILD_VERSION <value> into Dockerfiles. ENV instructions override ARG ones[1], so ART-built images will correctly use whatever ART injects, no matter if anything passes a value for the build arg or not.

[1] https://docs.docker.com/reference/dockerfile/#using-arg-variables

Co-authored-by: Petr Muller muller@redhat.com

Summary by CodeRabbit

  • Chores
  • Added optional build version metadata support across CI container images and installer build environments.
  • Standardized version handling for bare-metal, libvirt, OpenStack, and installer image builds.
  • Existing build workflows remain compatible when no version is provided.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@petr-muller
petr-muller deleted the trt-2892-installer-build-version-in-ci branch August 24, 2026 19:29
@openshift-cherrypick-robot

Copy link
Copy Markdown

@tthvo: new pull request created: #10801

Details

In response to this:

/cherry-pick release-5.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-robot

Copy link
Copy Markdown
Contributor

Fix included in release 5.1.0-0.nightly-2026-08-25-043742

petr-muller added a commit to petr-muller/release that referenced this pull request Sep 2, 2026
Will allow rehearse-test the changes in openshift/installer#10781 once it lands
petr-muller added a commit to petr-muller/release that referenced this pull request Sep 2, 2026
Will allow rehearse-test the changes in openshift/installer#10781 once it lands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria verified-later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants